<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Ventigrate.Shared.ExternalMembership.WebControls.UserEdit" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="VSEMS" Namespace="Ventigrate.Shared.ExternalMembership.WebControls" Assembly="$SharePoint.Project.AssemblyFullName$" %>

<asp:Content ID="Content1" contentplaceholderid="PlaceHolderPageTitle" runat="server">
	<SharePoint:EncodedLiteral ID="PageTitle" Text="Edit external user" EncodeMethod="HtmlEncode" runat="server"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
	<SharePoint:EncodedLiteral ID="TitleArea" Text="Edit external user" EncodeMethod="HtmlEncode" runat="server"/>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderId="PlaceHolderMain" runat="server">

    <wssuc:ToolBar id="onetidNavNodesTB" runat="server">
        <Template_Buttons>
            <wssuc:ToolBarButton 
                runat="server"
	            Text="Display Users"
	            id="idUsersDisp"
	            ToolTip="Display Users"
	            NavigateUrl="UsersDisp.aspx"
	            ImageUrl="/_layouts/images/VSEMS/usersdisp.png"
	            AccessKey="U" />
            <wssuc:ToolBarButton 
                runat="server"
	            Text="Display Roles"
	            id="idRolesDisp"
	            ToolTip="Display Roles"
	            NavigateUrl="RolesDisp.aspx"
	            ImageUrl="/_layouts/images/VSEMS/rolesdisp.png"
	            AccessKey="R"/>
        </Template_Buttons>
    </wssuc:ToolBar>

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="ms-descriptiontext">
    <!-- User Name -->
    <wssuc:InputFormSection runat="server" Title="User Name">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl runat="server" LabelText="Username is read only:">
			    <Template_Control>
			    <SharePoint:InputFormTextBox Title="Username" Enabled="false" ReadOnly="true" class="ms-input" Columns="40" maxlength="255" ID="txtUsername" Direction="LeftToRight" Runat="server" />
			    <SharePoint:InputFormRequiredFieldValidator ID="InputFormRequiredFieldValidator1" ControlToValidate="txtUsername" Display="Dynamic" Runat="server"/>
			    <asp:Label ID="usernameMessage" runat="server" Text="" ForeColor="red"></asp:Label>
			    </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>

    <!-- Password -->
    <wssuc:InputFormSection ID="PasswordSection" runat="server" Title="Password">
	    <Template_InputFormControls>
            <wssuc:InputFormControl runat="server" LabelText="Current password:">
			    <Template_Control>
                    <asp:Label ID="lblCurrentPassword" runat="server" Text="" class="ms-description"></asp:Label>
			    </Template_Control>
		    </wssuc:InputFormControl>
		    <wssuc:InputFormControl runat="server" LabelText="New password (leave empty to keep current password):">
			    <Template_Control>
			        <SharePoint:InputFormTextBox Title="password" ToolTip="Enter new password." class="ms-input" Columns="40" textmode="Password" maxlength="255" ID="txtPassword" Direction="LeftToRight" Runat="server" />
			        <SharePoint:InputFormTextBox Title="confirm" ToolTip="Confirm new password." class="ms-input" Columns="40" textmode="Password" maxlength="255" ID="txtConfirm" Runat="server" />
			        <SharePoint:InputFormCompareValidator ID="InputFormCompareValidatorPassword" SetFocusOnError="true"  ControlToValidate="txtConfirm" ControlToCompare="txtPassword" Type="String" Display="Dynamic" Operator="Equal" ErrorMessage="Password and confirmation do not match." runat="server"/>
			    </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>

    <!-- Email -->
    <wssuc:InputFormSection runat="server" Title="Email">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl runat="server" LabelText="Type the user's email address:">
			    <Template_Control>
			    <SharePoint:InputFormTextBox Title="txtEmail" class="ms-input" Columns="40" maxlength="255" ID="txtEmail" Direction="LeftToRight" Runat="server" />
			    <SharePoint:InputFormRegularExpressionValidator ID="InputFormRegExpressionFieldValidator1"  ControlToValidate="txtEmail" Display="Dynamic" runat="server" ValidationExpression="^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$" ErrorMessage="Enter a valid email address."/>
			    </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>

    <!-- Description -->
    <wssuc:InputFormSection runat="server" Title="Description">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl runat="server" LabelText="Type the description:">
			    <Template_Control>
			    <SharePoint:InputFormTextBox Title="txtDescription" class="ms-input" Columns="40" maxlength="255" ID="txtDescription" Direction="LeftToRight" Runat="server" />
			    </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>

    <!-- Active -->
    <wssuc:InputFormSection runat="server" Title="Active">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl runat="server">
			    <Template_Control>
				    <SharePoint:InputFormCheckBox ID="isActive" ToolTip="If checked the account is active." LabelText="Check the box if the user's account is active." runat="server"/>
			    </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>

    <!-- Roles -->
    <wssuc:InputFormSection runat="server" id="RolesSection" Title="Roles">
        <Template_InputFormControls>
	        <wssuc:InputFormControl runat="server">
		        <Template_Control>
			        <SharePoint:InputFormCheckBoxList ID="rolesList" CssClass="ms-RadioText" ToolTip="Select the roles for this user" runat="server"/>
		        </Template_Control>
	        </wssuc:InputFormControl>
        </Template_InputFormControls>
    </wssuc:InputFormSection>
    <wssuc:ButtonSection runat="server">
	    <Template_Buttons>
    	    <asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="OnSubmit" Text="Save" id="BtnOk" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>	    
	    </Template_Buttons>
    </wssuc:ButtonSection>
</table>
</asp:Content>
